package com.friend.entity.entity.base;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author friend
 * @since 2019-10-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_space")
@ApiModel(value="Space对象", description="")
@RequiredArgsConstructor(staticName = "of")
public class Space extends Model<Space> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "场名称")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "总人数")
    @TableField("count")
    private Integer count;

    @ApiModelProperty(value = "项目")
    @TableField("project")
    private String project;

    @ApiModelProperty(value = "地点")
    @TableField("address")
    private String address;

    @ApiModelProperty(value = "时间")
    @TableField("spacetime")
    private LocalDateTime spacetime;

    @ApiModelProperty(value = "发布者")
    @TableField("publish")
    private Integer publish;

    @ApiModelProperty(value = "当前用户是否参加")
    @TableField(exist = false)
    private Integer joinFlag;

    @ApiModelProperty(value = "该圈参加人数")
    @TableField(exist = false)
    private Integer circleCount;

    @ApiModelProperty(value = "该场参加人数")
    @TableField(exist = false)
    private Integer spaceCount;

    @ApiModelProperty(value = "创建人")
    @TableField("create_user")
    private Integer createUser;

    @ApiModelProperty(value = "创建人昵称")
    @TableField(exist = false)
    private String createUserStr;

    @ApiModelProperty(value = "修改人")
    @TableField("update_user")
    private Integer updateUser;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "删除标识")
    @TableField("del_flag")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "所属圈子")
    @TableField("circleId")
    private Integer circleId;



    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
